Compensation circuit for a TX-RX capacitive sensor

ABSTRACT

A capacitive sensor may include a transmit electrode and a receive electrode capacitively coupled with the transmit electrode. A capacitance sensing circuit senses a capacitance between the transmit and receive electrodes by applying a signal to the transmit electrode and rectifying a current waveform induced at the receive electrode. A compensation circuit reduces the effect of a mutual and parasitic capacitances of the transmit and receive electrode pair by adding a compensation current to the rectified current.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.13/345,504, filed on Jan. 6, 2012, which is a continuation of U.S.application Ser. No. 12/332,980, filed on Dec. 11, 2008, now U.S. Pat.No. 8,093,914 issued on Jan. 3, 2012, which claims the benefit of U.S.Provisional Patent Application No. 61/013,986, filed Dec. 14, 2007, allof which are incorporated by reference herein.

TECHNICAL FIELD

This disclosure relates to the field of user interface devices and, inparticular, to capacitive sensor devices.

BACKGROUND

Computing devices, such as notebook computers, personal data assistants(PDAs), kiosks, and mobile handsets, have user interface devices, whichare also known as human interface devices (HID). One user interfacedevice that has become more common is a touch-sensor pad (also commonlyreferred to as a touchpad). A basic notebook computer touch-sensor pademulates the function of a personal computer (PC) mouse. A touch-sensorpad is typically embedded into a PC notebook for built-in portability. Atouch-sensor pad replicates mouse X/Y movement by using two defined axeswhich contain a collection of sensor elements that detect the positionof a conductive object, such as a finger. Mouse right/left button clickscan be replicated by two mechanical buttons, located in the vicinity ofthe touchpad, or by tapping commands on the touch-sensor pad itself. Thetouch-sensor pad provides a user interface device for performing suchfunctions as positioning a pointer, or selecting an item on a display.These touch-sensor pads may include multi-dimensional sensor arrays fordetecting movement in multiple axes. The sensor array may include aone-dimensional sensor array, detecting movement in one axis. The sensorarray may also be two dimensional, detecting movements in two axes.

One type of touchpad operates by way of capacitance sensing utilizingcapacitance sensors. The capacitance, detected by a capacitance sensor,changes as a function of the proximity of a conductive object to thesensor. The conductive object can be, for example, a stylus or a user'sfinger. In a touch-sensor device, a change in capacitance detected byeach sensor in the X and Y dimensions of the sensor array due to theproximity or movement of a conductive object can be measured by avariety of methods. Regardless of the method, usually an electricalsignal representative of the capacitance detected by each capacitivesensor is processed by a processing device, which in turn produceselectrical or optical signals representative of the position of theconductive object in relation to the touch-sensor pad in the X and Ydimensions. A touch-sensor strip, slider, or button operates on the samecapacitance-sensing principle.

A first type of conventional touchpad is composed of a matrix of rowsand columns. Within each row or column, there are multiple sensorelements. However, all sensor pads within each row or column are coupledtogether and operate as one long sensor element. A second type ofconventional touchpad is composed of an XY array of independent senseelements, where each sensor element in a row or column is separatelysensed. Here, each row and column is composed of multiple sensingelements, each capable of independent detection of a capacitive presenceand magnitude. These may then be used to detect any number ofsubstantially simultaneous touches.

The capacitive sensing systems used in interface devices such astouchpads generally operate by detecting changes in the capacitances ofthe capacitive sensors resulting from proximity or contact of an objectwith the sensor, however the ability to resolve changes in capacitancemay be impaired if the changes in capacitance to be detected by thesensor are small relative to the capacitance of the sensor. Forinstance, a capacitive sensor element that is configured to detect aninput, such as proximity or contact with a finger or other object, mayhave a capacitance C_(P) between the sensor element and ground when noinput is present. The capacitance C_(P) is known as the parasiticcapacitance of the sensor. For capacitive sensors having multiple senseelements, a mutual capacitance C_(M) may also be present between two ormore sense elements. An input detected by the sensor may cause a changein capacitance C_(F) that is much smaller than C_(P) or C_(M).Accordingly, where the sensor capacitance is represented as a digitalcode, the parasitic or mutual capacitances may be represented by alarger proportion of the discrete capacitance levels resolvable by thedigital code, while the capacitance change C_(F) is represented by fewerof these discrete levels. In such cases, the capacitance change C_(F)due to an input may not be resolvable to a high degree of resolution.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure is illustrated by way of example, and not by wayof limitation, in the figures of the accompanying drawings.

FIG. 1A illustrates a block diagram of one embodiment of an electronicsystem having a processing device for detecting a presence of aconductive object.

FIG. 1B illustrates a block diagram of one embodiment of a device fordetecting an input and a location of the input on a touchpad.

FIG. 2A illustrates one embodiment of a circuit for detecting an inputat a capacitive sensor while compensating for parasitic and mutualcapacitance of capacitive sensor elements.

FIG. 2B illustrates voltage and current waveforms describing theoperation of one embodiment of a capacitance sensing circuit.

FIG. 3 illustrates one embodiment of a circuit for detecting themagnitude and location of an input while compensating for parasitic andmutual capacitance of capacitive sensor elements.

FIG. 4 illustrates one embodiment of a circuit for detecting themagnitude and location of an input while compensating for parasitic andmutual capacitance of capacitive sensor elements.

FIG. 5 illustrates one embodiment of a circuit for supplying acompensation current to a capacitance sensing circuit.

FIG. 6 is a flow chart illustrating a process for compensating forparasitic and mutual capacitances of sensor elements in a capacitancesensing circuit, according to one embodiment.

FIG. 7A is a block diagram illustrating one embodiment of a calibrationcircuit for calibrating a compensation circuit.

FIG. 7B is a flow chart illustrating a process for calibrating acompensation current in a capacitance sensing circuit, according to oneembodiment.

DETAILED DESCRIPTION

Described herein is a method and apparatus for measuring a capacitanceof a capacitive sensor while compensating for parasitic capacitanceinfluence and mutual capacitance constant part of the sensor. Thefollowing description sets forth numerous specific details such asexamples of specific systems, components, methods, and so forth, inorder to provide a good understanding of several embodiments of thepresent invention. It will be apparent to one skilled in the art,however, that at least some embodiments of the present invention may bepracticed without these specific details. In other instances, well-knowncomponents or methods are not described in detail or are presented insimple block diagram format in order to avoid unnecessarily obscuringthe present invention. Thus, the specific details set forth are merelyexemplary. Particular implementations may vary from these exemplarydetails and still be contemplated to be within the spirit and scope ofthe present invention.

Embodiments of a method and apparatus for detecting an input to acapacitive sensor are described. In one embodiment, the sensor elementsof a TX-RX capacitive sensor include at least one transmit (TX)electrode and at least one receive (RX) electrode. Each of the sensorelements, including the transmit and receive electrodes, has a parasiticcapacitance C_(P) and a mutual capacitance C_(M). The parasiticcapacitance of a sensor element is the capacitance between the sensorelement and ground. The mutual capacitance of the sensor element is thecapacitance between the sensor element and other sensor elements.

In one embodiment, a capacitance sensing circuit detects an input at thecapacitive sensor by detecting a change in the capacitance of a sensorelement. For example, a finger placed near a sensor element may cause adecrease in the capacitance of the sensor element. The magnitude of thischange in capacitance can be detected and converted to a voltage levelor a digital code that can be processed by a computer or other circuit.

In one embodiment for using a capacitive sensor having transmit andreceive electrodes, a signal applied to a transmit electrode induces acurrent at a receive electrode due to capacitive coupling between thetransmit and receive electrodes. The magnitude of the current induced atthe receive electrode depends on the degree of capacitive couplingbetween the electrodes. The proximity of an object, such as a finger,near the electrodes may change the capacitance between the electrodes,as well as the capacitance between the electrodes and ground. Thischange in turn affects the amount of current induced at the receiveelectrode. Thus, the magnitude of the induced current reflects thechange in capacitance of the transmit and receive electrodes due to theinput. In one embodiment, the induced current may further be convertedto a digital code and represented as one of a finite number of discretelevels.

The measured capacitance of the sensor element also includes theparasitic and mutual capacitances C_(P) and C_(M) in addition to C_(F).The baseline capacitance may also be described as the capacitance of thesensor element when no input (i.e., a finger touch) is present. Theability of the digital code to resolve many levels of C_(F) may bedegraded if the baseline capacitance, resulting from C_(P) and C_(M), islarge in comparison to C_(F). Therefore, the dynamic range of theconversion circuit is not used effectively, as the small variations ofC_(M) are measured in the presence of the large base value of C_(M).Thus, in one embodiment, the effects of base value of C_(M) arecompensated, allowing the digital code to resolve C_(F) using a greaternumber of discrete levels, improving the dynamic range utilization byscaling the small capacitance changes to the full input range of thecapacitance sensing circuit

One embodiment of a compensation circuit that minimizes the effects ofparasitic and constant part of the mutual capacitances supplies acompensation current that is calibrated to cancel a portion of currentattributable to the baseline capacitance of the sensor. Thus, thesynchronously demodulated current from the receive electrode isminimized when no input is present at the capacitive sensor.Accordingly, more of the discrete levels resolvable by the digital codeare available for representing the full dynamic range of C_(F). Theparasitic capacitance C_(P) of the receive electrode is compensated bykeeping the receive electrode potential close to constant during circuitoperation using the voltage buffer, reducing the effects of rechargingC_(P) during circuit operation.

FIG. 1A illustrates a block diagram of one embodiment of an electronicsystem in which a capacitance sensor with a parasitic and mutualcapacitance compensation circuit can be implemented. Electronic system100 includes processing device 110, touch-sensor pad 120, touch-sensorslider 130, touch-sensor buttons 140, host processor 150, embeddedcontroller 160, and non-capacitance sensor elements 170. The processingdevice 110 may include analog and/or digital general purposeinput/output (“GPIO”) ports 107. GPIO ports 107 may be programmable.GPIO ports 107 may be coupled to a Programmable Interconnect and Logic(“PIL”), which acts as an interconnect between GPIO ports 107 and adigital block array of the processing device 110 (not illustrated). Thedigital block array may be configured to implement a variety of digitallogic circuits (e.g., DACs, digital filters, or digital control systems)using, in one embodiment, configurable user modules (“UMs”). The digitalblock array may be coupled to a system bus. Processing device 110 mayalso include memory, such as random access memory (RAM) 105 and programflash 104. RAM 105 may be static RAM (SRAM), and program flash 104 maybe a non-volatile storage, which may be used to store firmware (e.g.,control algorithms executable by processing core 102 to implementoperations described herein). Processing device 110 may also include amemory controller unit (MCU) 103 coupled to memory and the processingcore 102.

The processing device 110 may also include an analog block array (notillustrated). The analog block array is also coupled to the system bus.Analog block array also may be configured to implement a variety ofanalog circuits (e.g., ADCs or analog filters) using, in one embodiment,configurable UMs. The analog block array may also be coupled to the GPIO107.

As illustrated, capacitance sensing circuit 101 may be integrated intoprocessing device 110. Capacitance sensing circuit 101 may includeanalog I/O for coupling to an external component, such as touch-sensorpad 120, touch-sensor slider 130, touch-sensor buttons 140, and/or otherdevices. Capacitance sensing circuit 101 and processing device 102 aredescribed in more detail below.

The embodiments described herein are not limited to touch-sensor padsfor notebook implementations, but can be used in other capacitivesensing implementations, for example, the sensing device may be a touchscreen, a touch-sensor slider 130, or touch-sensor buttons 140 (e.g.,capacitance sensing buttons). In one embodiment, these sensing devicesmay include one or more capacitive sensors. It should also be noted thatthe embodiments described herein may be implemented in other sensingtechnologies than capacitive sensing, such as resistive, opticalimaging, surface wave, infrared, dispersive signal, and strain gaugetechnologies. Similarly, the operations described herein are not limitedto notebook pointer operations, but can include other operations, suchas lighting control (dimmer), volume control, graphic equalizer control,speed control, or other control operations requiring gradual or discreteadjustments. It should also be noted that these embodiments ofcapacitive sensing implementations may be used in conjunction withnon-capacitive sensing elements, including but not limited to pickbuttons, sliders (ex. display brightness and contrast), scroll-wheels,multi-media control (ex. volume, track advance, etc) handwritingrecognition and numeric keypad operation.

In one embodiment, the electronic system 100 includes a touch-sensor pad120 coupled to the processing device 110 via bus 121. Touch-sensor pad120 may include a multi-dimension sensor array. The multi-dimensionsensor array includes multiple sensor elements, organized as rows andcolumns. In another embodiment, the electronic system 100 includes atouch-sensor slider 130 coupled to the processing device 110 via bus131. Touch-sensor slider 130 may include a single-dimension sensorarray. The single-dimension sensor array includes multiple sensorelements, organized as rows, or alternatively, as columns. In anotherembodiment, the electronic system 100 includes touch-sensor buttons 140coupled to the processing device 110 via bus 141. Touch-sensor buttons140 may include a single-dimension or multi-dimension sensor array. Thesingle- or multi-dimension sensor array may include multiple sensorelements. For a touch-sensor button, the sensor elements may be coupledtogether to detect a presence of a conductive object over the entiresurface of the sensing device. Alternatively, the touch-sensor buttons140 may have a single sensor element to detect the presence of theconductive object. In one embodiment, touch-sensor buttons 140 mayinclude a capacitive sensor element. Capacitive sensor elements may beused as non-contact sensor elements. These sensor elements, whenprotected by an insulating layer, offer resistance to severeenvironments.

The electronic system 100 may include any combination of one or more ofthe touch-sensor pad 120, touch-sensor slider 130, and/or touch-sensorbutton 140. In another embodiment, the electronic system 100 may alsoinclude non-capacitance sensor elements 170 coupled to the processingdevice 110 via bus 171. The noncapacitance sensor elements 170 mayinclude buttons, light emitting diodes (LEDs), and other user interfacedevices, such as a mouse, a keyboard, or other functional keys that donot require capacitance sensing. In one embodiment, buses 171, 141, 131,and 121 may be a single bus. Alternatively, these buses may beconfigured into any combination of one or more separate buses.

Processing device 110 may include internal oscillator/clocks 106 andcommunication block 108. The oscillator/clocks block 106 provides clocksignals to one or more of the components of processing device 110.Communication block 108 may be used to communicate with an externalcomponent, such as a host processor 150, via host interface (I/F) line151. Alternatively, processing block 110 may also be coupled to embeddedcontroller 160 to communicate with the external components, such as host150. In one embodiment, the processing device 110 is configured tocommunicate with the embedded controller 160 or the host 150 to sendand/or receive data.

Processing device 110 may reside on a common carrier substrate such as,for example, an integrated circuit (IC) die substrate, a multi-chipmodule substrate, or the like. Alternatively, the components ofprocessing device 110 may be one or more separate integrated circuitsand/or discrete components. In one exemplary embodiment, processingdevice 110 may be a Programmable System on a Chip (PSoC™) processingdevice, manufactured by Cypress Semiconductor Corporation, San Jose,Calif. Alternatively, processing device 110 may be one or more otherprocessing devices known by those of ordinary skill in the art, such asa microprocessor or central processing unit, a controller,special-purpose processor, digital signal processor (DSP), anapplication specific integrated circuit (ASIC), a field programmablegate array (FPGA), or the like.

It should also be noted that the embodiments described herein are notlimited to having a configuration of a processing device coupled to ahost, but may include a system that measures the capacitance on thesensing device and sends the raw data to a host computer where it isanalyzed by an application. In effect the processing that is done byprocessing device 110 may also be done in the host.

Capacitance sensing circuit 101 may be integrated into the IC of theprocessing device 110, or alternatively, in a separate IC.Alternatively, descriptions of capacitance sensing circuit 101 may begenerated and compiled for incorporation into other integrated circuits.For example, behavioral level code describing capacitance sensingcircuit 101, or portions thereof, may be generated using a hardwaredescriptive language, such as VHDL or Verilog, and stored to amachine-accessible medium (e.g., CD-ROM, hard disk, floppy disk, etc.).Furthermore, the behavioral level code can be compiled into registertransfer level (“RTL”) code, a netlist, or even a circuit layout andstored to a machine-accessible medium. The behavioral level code, theRTL code, the netlist, and the circuit layout all represent variouslevels of abstraction to describe capacitance sensing circuit 101.

It should be noted that the components of electronic system 100 mayinclude all the components described above. Alternatively, electronicsystem 100 may include only some of the components described above.

In one embodiment, electronic system 100 may be used in a notebookcomputer. Alternatively, the electronic device may be used in otherapplications, such as a mobile handset, a personal data assistant (PDA),a keyboard, a television, a remote control, a monitor, a handheldmulti-media device, a handheld video player, a handheld gaming device,or a control panel.

FIG. 1B is a block diagram illustrating one embodiment of a TX-RXcapacitive touchpad sensor and a capacitance sensing circuit thatconverts measured capacitances to touchpad coordinates. Touch sensor 120includes a matrix 125 of N×M electrodes (N receive electrodes and Mtransmit electrodes), which further includes transmit (TX) electrode 122and receive (RX) electrode 123. Each of the electrodes in matrix 125 isconnected with capacitance sensing circuit 101 through multiplexors 112and 113. Capacitance sensing circuit 101 includes multiplexor control111, multiplexors 112 and 113, clock generator 114, signal generator115, demodulation circuit 116, and current to code (I to code) converter117. Current to code converter 117 is further coupled with touchcoordinate converter 118.

The transmit and receive electrodes in the electrode matrix 125 arearranged so that each of the transmit electrodes intersects each of thereceive electrodes. Thus, each transmit electrode is capacitivelycoupled with each of the receive electrodes. For example, transmitelectrode 122 is capacitively coupled with receive electrode 123 at thepoint where transmit electrode 122 and receive electrode 123 intersect.

Clock generator 114 supplies a clock signal to signal generator 115,which produces a TX signal 124 to be supplied to the transmit electrodesof touch sensor 120. In one embodiment, the signal generator 115includes a set of switches that operate according to the clock signalfrom clock generator 114. The switches may generate a TX signal 124 byperiodically connecting the output of signal generator 115 first to asupply voltage and then to ground.

The output of signal generator 115 is connected with multiplexor 112,which allows the TX signal 124 to be applied to any of the M transmitelectrodes of touch sensor 120. In one embodiment, multiplexor control111 controls multiplexor 112 so that the TX signal 124 is applied toeach transmit electrode in sequence. Multiplexor 112 may also be used toground the other transmit electrodes to which the TX signal 124 is notcurrently being applied.

Because of the capacitive coupling between the transmit and receiveelectrodes, the TX signal 124 applied to each transmit electrode inducesa current at each of the receive electrodes. For instance, when the TXsignal 124 is applied to transmit electrode 122 through multiplexor 112,the TX signal 124 induces an RX signal 126 on the receive electrodes inmatrix 125. The RX signal 126 on each of the receive electrodes can thenbe measured in sequence by using multiplexor 113 to connect each of theN receive electrodes to demodulation circuit 116 in sequence.

The capacitance associated with each intersection between a TX electrodeand an RX electrode can be sensed by selecting every availablecombination of TX electrode and an RX electrode using multiplexors 112and 113.

When an object, such as a finger, approaches the electrode matrix 125,the object causes a decrease in capacitance affecting only some of theelectrodes. For example, if a finger is placed near the intersection oftransmit electrode 122 and receive electrode 123, the presence of thefinger will decrease the capacitance between the two electrodes 122 and123. Thus, the location of the finger on the touchpad can be determinedby identifying both the receive electrode having a decreased capacitanceand the transmit electrode to which the TX signal 124 was applied at thetime the decreased capacitance was measured on the receive electrode.

Thus, by sequentially determining the capacitances associated with eachintersection of electrodes in the matrix 125 the locations of one ormore inputs can be determined.

The induced current waveform 126 is rectified by demodulation circuit116. The rectified current output by demodulation circuit 116 can thenbe filtered and converted to a digital code by I to code converter 117.The digital code is converted to touch coordinates indicating a positionof an input on touch sensor pad by touch coordinate converter 118.

FIG. 2A illustrates one embodiment of a capacitance sensing circuit thatincludes a compensation circuit for minimizing effects of parasitic andmutual capacitance. Capacitance sensing circuit 200 includesmultiplexors 112 and 113, clock generator 114, signal generator 115,demodulation circuit 116, and current to code (I to code) converter 117.Signal generator 115 includes switches 211 and 212. Demodulation circuit116 includes switches 231 and 232, and analog buffer 233. I to codeconverter 117 includes transimpedance amplifier (TIA) 240 and analog todigital converter (ADC) 242. TIA 240 includes an operational amplifier241 and feedback network 243.

Clock generator 114 provides two different clock signals, clock 221 andclock 222, to signal generator 115. In one embodiment, the clock 221 andclock 222 signals are non-overlapping signals, so that the clock 221 andclock 222 signals are never simultaneously asserted. Signal generator115 includes switches 211 and 212, which are controlled by the clock 221and clock 222 signals, respectively. Thus, switches 211 and 212 operatein a non-overlapping manner to alternately connected node 213 first tosupply voltage Vcc and then to ground. This generates a TX signal onnode 213 that oscillates between Vcc and ground.

Multiplexor 112 applies the TX signal to TX node 226. TX node 226 may beone of many transmit nodes connected to multiplexor 112. For example,with reference to FIG. 1B, TX node 226 may represent one of the transmitelectrodes in electrode matrix 125, such as transmit electrode 122. TXnode 226 is capacitively coupled to ground through parasitic capacitanceC_(PT) 223, and is capacitively coupled to RX node 227 through mutualcapacitance C_(M) 225.

The TX signal applied to TX node 226 induces a corresponding signal onRX node 227 because of the capacitive coupling between TX node 226 andRX node 227. In one embodiment, RX node 227 may be one of many receiveelectrodes selectable using multiplexor 113. For example, referring toFIG. 1B, RX node 227 may be one of the receive electrodes in electrodematrix 125, such as receive electrode 123. RX node 227 is capacitivelycoupled to ground through parasitic capacitance CPR 224.

FIG. 2B illustrates voltage and current waveforms describing theoperation of one embodiment of a capacitance sensing circuit, such ascapacitance sensing circuit 200. With reference to FIG. 2B, the TXsignal waveform 261 corresponds to the signal at node 213 that isapplied to TX node 226 through multiplexor 112. The induced currentwaveform 262 describes the current that is induced at RX node 227 by TXsignal 261, due to capacitive coupling between TX node 226 and RX node227.

The induced current 262 is applied to the input of the demodulationcircuit 116. Demodulation circuit 116 rectifies the induced current 262using switches 231 and 232 and analog buffer 233. Switches 231 and 232are operated in a nonoverlapping manner using the clock 221 and clock222, respectively. Thus, switches 231 and 232 are not simultaneouslyclosed at any point in the switching cycle. When switch 231 is closed,analog buffer 233 is connected to RX node 227 through multiplexor 113,and maintains a constant voltage at RX node 227. In one embodiment, theanalog buffer 233 is a unity gain amplifier. The input of analog buffer233 is connected to node 234, which is driven to VREF by operationalamplifier 241. Thus, the analog buffer 233 maintains the voltage levelVREF at RX node 227 while switch 231 is closed.

Since switches 231 and 211 are both controlled using the clock 221signal, the time period during which switch 231 is closed coincides withthe time during which TX node 226 is connected to Vcc. During this timeperiod, current flows out of RX node 227 due to the voltage rise of theTX signal from ground to Vcc.

Since switches 232 and 212 are both controlled by the clock 222 signal,switch 232 is closed during the time that TX node 226 is connected toground. During this time, current flows into RX node 227 due to the dropin voltage at TX node 226.

When switch 232 is closed, switch 231 is open and analog buffer 233 isdisconnected from RX node 227. During this time period, RX node 227 isconnected with node 234 through multiplexor 113. Since current isflowing into RX node 227 during this time, current is drawn out of node234 through the closed switch 232.

The demodulation circuit thus performs as a half-wave rectifier for thenegative current peaks in the induced current 262. Referring to FIG. 2B,the rectified current 263 corresponds to the rectified signal at node234.

The rectified current 263 is applied to the input of current to codeconverter 117. Current to code converter 117 receives a current as inputand outputs a digital code corresponding to the input current. Thus, theconverter 117 converts the rectified current 263 to a digital code that,like the rectified current 263, depends on the capacitance between theTX node 226 and the RX node 227. The digital code corresponding to thismeasured capacitance can then be processed by a computer or othercircuit.

The current to code converter 117 converts the rectified current 263 toa digital code using a transimpedance amplifier (TIA) 240 and an analogto digital converter (ADC) 242. The TIA 240 converts the current 263into a voltage, and the ADC 242 converts the voltage into a digitalcode. Node 234, into which the current 263 flows, is connected to aninverting input of operation amplifier 241, which has its outputconnected to the inverting input through feedback network 243.Operational amplifier 241 maintains the voltage at its inverting inputto be approximately equal to the voltage V_(REF) applied to itsnon-inverting input by driving its output to a particular voltage level.This TIA output voltage level 264 is converted to a digital code by theADC 242.

When an input is received at the capacitive sensor, the capacitancebetween TX node 226 and RX node 227 changes. For example, nodes 226 and227 may be electrodes in an electrode matrix 125. A finger touch nearnodes 226 and 227 may shunt to ground part of the electric fieldproduced by the TX signal 261 at TX node 226. Thus, the effect of thefinger touch is to decrease the capacitance between the TX and RX nodes226 and 227.

A change in capacitance due to an input at the capacitive sensor can bemodeled by capacitor C_(F) 230 in parallel with mutual capacitance C_(M)225 between TX node 226 and RX node 227. Since the presence of an inputdecreases the capacitance between TX node 226 and RX node 227, C_(F) 230has a negative value. Physically, the negative value of C_(F) means thatthe cumulative mutual capacitance is reduced at touch due to theshunting of part of the electric field to ground.

When a conductive object, such as a finger, approaches TX node 226 andRX node 227, the capacitance between these nodes 226 and 227 decreases,which means that the capacitive coupling between the nodes 226 and 227decreases. Accordingly, the magnitude of the current induced at RX node227 due to TX signal 261 is decreased. The decreased induced currentwaveform is rectified and converted to a voltage by TIA 240, asdescribed above. The decrease in the resulting voltage may be convertedto a digital code and detected as an input.

The change in capacitance C_(F) due to an input may be small relative tothe baseline capacitance (resulting from C_(M) 225 and the parasiticcapacitances C_(PT) 223 and C_(PR) 224). Therefore, the correspondingdecrease in voltage due to an input may likewise be small. For example,the baseline capacitance between nodes 226 and 227, as measured when noinput is present, may be on the order of 3.0 pF. An object near thenodes 226 and 227 may only decrease the capacitance a few percent to 2.9pF.

Since the change in capacitance C_(F) is small as compared to thebaseline capacitance, the decrease in voltage due to an input iscorrespondingly small as compared to the baseline voltage that isproduced when no input is present at the capacitive sensor electrodes.Therefore, when the voltage is converted to a digital code capable ofresolving a finite number of levels, only a relatively small number ofthese levels may correspond to the dynamic range of the voltage changedue to the input.

This effect of the baseline capacitance can be removed by using acompensation circuit that adds a compensation current to the rectifiedcurrent output from demodulation circuit 116. The compensation currentcan be used to cancel the portion of the rectified current that isattributable to the baseline capacitance.

In one embodiment, the compensation circuit includes a current digitalto analog converter (IDAC) 228, which is configured to supply acompensation current into node 234. In one embodiment, IDAC 228 is aprogrammable IDAC for which an output compensation current can beselected from a range of available current levels.

In one embodiment, a switched capacitor may be used to supply thecompensation current. For example, the negative electrode of theswitched capacitor may be connected to ground while the positiveelectrode is alternately switched between a supply voltage and node 234.The switching frequency can then be adjusted to control the level of thecompensation current.

When no input is present at the capacitive sensor, the baselinecapacitance of the sensor causes a baseline rectified current out ofnode 234. IDAC 228 cancels the effect of the baseline capacitance byadding a level of compensation current to minimize the net flow ofcurrent into or out of node 234.

When a conductive object approaches the TX and RX nodes 226 and 227, thecompensation current can be added to the resulting rectified currentusing IDAC 228 to produce a compensated current waveform. Thecompensated current waveform is applied to the input of TIA 240.

With the effect of the baseline capacitance minimized, the change incapacitance CF due to an input results in a greater decrease in voltageat the output of TIA 240. The compensation circuit thus improvesutilization of the dynamic range of the ADC 242.

In one embodiment, the compensated current waveform is filtered usingfeedback network 243 to reduce the ripple of the voltage output by TIA240 before applying it to the input of ADC 242. In one embodiment,feedback network 243 may be an RC network including a feedback resistorRFB and a feedback capacitor CFB.

In one embodiment the compensation signal source can be connected beforedemodulation switches 231 and 232 directly to the output of multiplexer113.

In one embodiment, the above measurement and compensation process isperformed for each pair of transmit and receive electrodes in matrix125.

FIG. 3 illustrates compensation of the baseline capacitance in acapacitance sensing circuit 300 that performs a full wave rectificationof the induced current waveform flowing out of RX node 227, according toone embodiment. Capacitance sensing circuit 300 includes IDACs 301 and302, rectification switches 303 and 304, reset switches 306 and 307,integration capacitors 310 and 311, differential amplifier 308, andanalog to digital converter (ADC) 309.

The full wave rectification performed by capacitance sensing circuit 300improves the immunity of the circuit 300 to low frequency noise, such asnoise caused by AC power line or mains voltages. For example, parasiticcharge accumulated in the sensor electrodes due to a 60 Hz AC mainsvoltage change during one phase is balanced by an opposite chargeaccumulated during the next phase.

In capacitive sensing circuit 300, the induced current flowing out of RXnode 227 is rectified by the operation of switches 303 and 304. In oneembodiment, switches 303 and 212 are controlled by a first clock signal,while switches 304 and 211 are controlled by a second clock signal thatis non-overlapping with respect to the first clock signal. Thus,switches 303 and 304 operate in a non-overlapping manner to rectify boththe positive and negative portions of the induced current flowing out ofnode 227.

For example, when switch 304 is closed, switch 303 is open and switch211 is closed. Switch 211 connects TX node 226 with VDD. The increase involtage at TX node 226 causes a flow of current out of RX node 227 dueto the capacitive coupling between nodes 226 and 227. The inducedcurrent flowing out of RX node 227 is supplied through closed switch 304to the node connected to the non-inverting input of differentialamplifier 308.

When switch 303 is closed, switch 304 is open and switch 212 is closed.Switch 211 connects TX node 226 with ground. The decrease in voltage atTX node 226 causes a flow of current into RX node 227 due to thecapacitive coupling between nodes 226 and 227. The induced currentflowing into RX node 227 is drawn through closed switch 303 from thenode connected to the inverting input of differential amplifier 308.

Thus, a first rectified current IR 312 flows into the non-invertinginput node of differential amplifier 308 and a second rectified currentIR2 313 flows out of the inverting input node of differential amplifier308. IDACs 302 and 301 supply compensation currents at levels thatminimize the current flow into and out of these nodes when no input ispresent. Specifically, IDAC 301 supplies a compensation current into theinverting input node to cancel the current IR2313 flowing out of thenode. IDAC 302 draws a compensation current out of the non-invertinginput node to cancel the current IR 312 flowing into the node.

Differential amplifier 308 and integration capacitors 310 and 311function together as a differential integrator. Integration capacitors310 and 311 are used to integrate charge resulting from the net flow ofcurrent into or out of the input nodes of differential amplifier 308,allowing a potential difference to build up between the inputs ofdifferential amplifier 308 over the duration of an integration period.Based on this potential difference, differential amplifier 308 outputs avoltage to ADC 309, which converts the voltage to a digital code. Resetswitches 306 and 307 can be closed to discharge capacitors 311 and 310in preparation for a subsequent integration period.

FIG. 4 illustrates compensation of the baseline capacitance in acapacitance sensing circuit 400 that performs a full wave rectificationof the induced current waveform flowing out of RX node 227, according toone embodiment. Capacitance sensing circuit 400 includes a differentialamplifier 420. Differential amplifier 420 includes operationalamplifiers 408 and 409, and instrumentation amplifier (INA) 410.Operational amplifiers 408 and 409 are connected to feedback networks403 and 404, respectively. The input nodes of differential amplifier 420are supplied with compensation currents from IDACs 401 and 402.

In capacitance sensing circuit 400, the induced current flowing out ofRX node 227 is rectified by the operation of switches 303 and 304, aspreviously described with reference to FIG. 3. Thus, a first rectifiedcurrent IR 412 flows into the inverting input node of operationalamplifier 409 and a second rectified current IR2 413 flows out of theinverting input node of operation amplifier 408. IDACs 402 and 401supply compensation currents at levels that minimize the current flowinto and out of these nodes when no input is present. Specifically, IDAC401 supplies a compensation current into the inverting input node ofoperation amplifier 408 to cancel the current IR2 413 flowing out of thenode. IDAC 402 draws a compensation current out of the inverting inputnode of operation amplifier 409 to cancel the current IR 412 flowinginto the node.

Operational amplifiers 408 and 409 of differential amplifier 420 drivetheir outputs to sufficient voltage levels to maintain their invertinginputs near reference voltage V_(REF), which is applied to thenon-inverting inputs of operational amplifiers 408 and 409. The outputvoltages of operational amplifiers 408 and 409 are filtered to reducetheir ripple voltages. In one embodiment, the filtering is performedusing feedback networks 403 and 404, which may include feedbackcapacitors C_(FB1) and C_(FB2) and feedback resistors R_(FB1) andR_(FB2).

The output voltages of operational amplifiers 408 and 409 are applied tothe inverting and non-inverting inputs of instrumentation amplifier(INA) 410. Based on these voltages, INA 410 generates an output voltage,which is converted to a digital code by ADC 411.

FIG. 5 illustrates one embodiment of a compensation circuit 500 forgenerating compensation currents using a single IDAC 507. Compensationcircuit 500 includes current mirrors 501 and 502 and IDAC 507.

IDAC 507 supplies a reference current IREF 503 to current mirror 502.Current mirror 502 mirrors current IREF 503 and generates currents IM504 and IDAC− 506, which are approximately equal to IREF 503. Current IMis further mirrored by current mirror 501, which generates current IDAC+505, which is approximately equal to IM. The currents IDAC+ 505 andIDAC− 506 can be used as compensation currents for a capacitance sensingcircuit with full wave rectification, such as capacitance sensingcircuit 300 or 400.

FIG. 6 is a flow diagram illustrating a process for sensing capacitanceof a capacitive sensor, according to one embodiment. Capacitance sensingprocess 600 may be implemented, for example, by capacitance sensingcircuits 200, 300, and 400.

At block 602, a transmit signal may be generated. In one embodiment, thetransmit signal may be similar to TX signal 261, which can be generatedby switching a node to which the transmit signal is applied between asupply voltage Vcc and ground.

At block 604, the transmit signal may be applied to a transmit electrodeto induce a current at a receive electrode that is capacitively coupledwith the transmit electrode. For example, in capacitance sensing circuit200, TX signal 261 may be applied to TX node 226 to induce a currentflowing into or out of RX node 227. The induced current waveformgenerated may include positive and negative peaks, corresponding tocurrent flowing into and out of the receive electrode.

At block 606, the induced current waveform may be rectified. In oneembodiment, the rectification may be performed using switches, such asswitches 231 and 232, that are operated synchronously with the switchingused to generate the transmit signal. In one embodiment, the inducedcurrent waveform is rectified using a half wave rectifier, such asdemodulation circuit 116 in capacitance sensing circuit 200.Alternatively, the rectification may be a full wave rectification, asimplemented in capacitance sensing circuits 300 or 400.

At block 608, a compensation current may be added to the rectifiedcurrent. For example, in capacitance sensing circuit 200, IDAC 228 addsa compensation current to the rectified current flowing out of node 234.In one embodiment, the magnitude of the compensation current isapproximately equal to the magnitude of the baseline rectified current.IDAC 228 supplies the compensation current into node 234 to compensatefor the baseline rectified current flowing out of node 234.

At block 610, the compensated current waveform may be converted to anoutput voltage. In one embodiment, this conversion is performed by atransimpedance amplifier (TIA). For example, in capacitance sensingcircuit 200, the compensated current waveform is converted to a voltageby TIA 240. Alternatively, the conversion may be performed by adifferential integrator, such as the differential integrator ofcapacitance sensing circuit 300 that includes differential amplifier 308and capacitors 310 and 311, or a differential amplifier such asdifferential amplifier 420 of capacitance sensing circuit 400.

At block 612, the output voltage may be filtered to reduce ripple in theoutput voltage. The output voltage may be characterized by a significantamount of ripple if it is generated from a current induced by a transmitsignal including a series of pulses. For example, TX signal 261, whenapplied to a transmit electrode, causes a rectified current 263 withcorresponding periodic pulses. This rectified current, if converted to avoltage without filtering, will result in an output voltagecharacterized by a significant ripple voltage. Thus, in one embodiment,filtering may be performed by a feedback network such as feedbacknetwork 243 connected to the output of operational amplifier 241. Inalternative embodiments, the filtering may be performed by integrationcapacitors, such as C_(INT1) 311 and C_(INT2) 310 of capacitance sensingcircuit 300, or by feedback networks 403 and 404 of capacitance sensingcircuit 400. The filtering reduces ripple in the output voltagegenerated from the rectified current. For example, TIA output 264 isoutput from TIA 240 and is characterized by a smaller ripple voltagethan would be produced without filtering.

At block 614, the filtered output voltage can be converted to a digitalcode. In one embodiment, the conversion of the output voltage to thedigital code may be performed by an analog to digital converter (ADC),such as ADC 242 of capacitance sensing circuit 200, ADC 309 ofcapacitance sensing circuit 300, or ADC 411 of capacitance sensingcircuit 400. In one embodiment, the output voltage may be represented bythe density of asserted bits in an output bitstream. Alternatively, thelevel of the output voltage may be represented by a binary coding. Thedigital code can be processed by a computer system or other circuit.

In one embodiment, the operations represented in blocks 602-614 may beperformed continuously during the operation of a capacitance sensingcircuit in which they are implemented, so that inputs to the capacitivesensor can be tracked continuously. For example, if the capacitivesensor is an electrode matrix such as electrode matrix 125, thecapacitance sensing circuit may track the position of finger causing aninput over time. In alternative embodiments, the operations ofcapacitance sensing process 600 may be performed periodically.

FIG. 7A illustrates a block diagram of one embodiment of a calibrationcircuit for calibrating a compensation circuit. The calibration circuitand compensation circuit can be used in a capacitive sensing circuit,such as capacitive sensing circuits 200, 300, or 400. Calibrationcircuit 700 may be used to set an appropriate compensation current to beoutput by the compensation circuitry, represented by IDAC 702. In oneembodiment, the calibration circuit 700 determines a compensationcurrent that is approximately equal to the baseline rectified currentoutput by demodulation circuit 116. The baseline rectified current isthe rectified current output by the demodulation circuit 116 when noinput is present at the capacitive sensor.

In one embodiment, calibration circuit 700 may calibrate the IDAC 702when no input is present so that the calibration circuit 700 can measurethe baseline rectified current. For example, if the calibration circuit700 used with a capacitance sensing circuit and capacitive sensor in auser interface device, the calibration process may be performed at atime during which the user is instructed not to touch the capacitivesensor, or at a time when inputs to the capacitive sensor are expectednot to occur. During this time, a baseline induced current waveform froma receive electrode is rectified by the demodulation circuit to generatea baseline rectified current, according to one embodiment. The baselinerectified current is converted to a digital code by current to code (Ito code) converter 117 and transmitted to the calibration circuit 700.

The digital code can then be processed by the calibration circuit 700.For example, the digital code received by the calibration circuit 700may include a sequence of digitally coded voltage levels, which may beaveraged over time by the calibration circuit. The calibration circuit700 may also perform other operations on the digital code, such asadding or subtracting an offset, or filtering.

Based on the processed digital code, the calibration circuit determinesa compensation current level to be output by IDAC 702 and stores a valuerepresenting this level in memory 701. In one embodiment, thecalibration circuit 700 stores in memory 701 a compensation currentlevel that is approximately equal to an average of the baselinerectified current detected during the calibration process.

In one embodiment, the compensation current, when output by IDAC 702, ismore likely to accurately cancel the baseline rectified current, sincethe compensation current level is based on an empirically determinedbaseline rectified current.

During normal operation of the capacitive sensing circuit (i.e., thecapacitive sensing circuit is detecting inputs at a capacitive sensor),the calibration circuit 700 may access the memory 701 to determine thelevel of compensation current to be output by the IDAC 702. Thecalibration circuitry controls IDAC 702 to cause the IDAC 702 to outputthis level of compensation current.

In one embodiment, the calibration circuit 700 and compensation circuit,represented by IDAC 702, are implemented in a capacitance sensingcircuit that measures capacitances of a number of sensor elements. Forexample, the capacitance sensing circuit may be configured to measurecapacitances between each pair of transmit and receive electrodes in anelectrode matrix, such as matrix 125. For such embodiments, thecalibration circuit may perform a calibration process for each possiblepair of a transmit and a receive electrode. For example, if an electrodematrix includes 20 transmit electrodes and 30 receive electrodes, thecalibration process would be performed 20×30 times, or 600 times. Thus,the calibration process is performed once for each possible pair oftransmit and receive electrodes. The 600 resulting compensation currentlevels can be stored in the memory 701. During normal operation of thecapacitance sensing circuit, the compensation current level associatedwith a particular pair of a transmit and a receive electrode can beretrieved from the memory and used to cancel the baseline rectifiedcurrent produced when the capacitance of that particular pair is beingsensed.

FIG. 7B is a flow chart illustrating a process for calibratingcompensation circuitry for use in a capacitive sensing circuit. Theoperations of calibration process 750 may be performed by calibrationcircuit 700.

The calibration process may begin at block 752, and continue at block754. At block 754, the initial pair of transmit and receive electrodesmay be connected to the capacitive sensing circuit. For example, incapacitive sensing circuit 101, multiplexor control 111 may be used tocontrol multiplexor 112 to connect the initial transmit electrode to thesignal generator 115 and to control multiplexor 113 to connect theinitial receive electrode to demodulation circuit 116.

At block 756, an IDAC used as a compensation circuit may be set to astart value. In one embodiment, the IDAC is a programmable IDAC forwhich an output current can be set by storing a digital value in aregister of the IDAC. In one embodiment, the compensation circuitry mayuse a current source such as a switched capacitor, where the switchingfrequency can be adjusted to set the current output.

At block 758, the IDAC may be used to add a current, according to itscurrently set value, to the baseline rectified current. For example, incapacitance sensing circuit 200, the IDAC 228 supplies a compensationcurrent into node 234. Since the baseline rectified current is drawn outof node 234, the compensation current supplied by the IDAC 228 is addedto the baseline rectified current. For example, the baseline rectifiedcurrent may be drawn out of node 234 and the compensation current may besupplied into node 234, reducing the net current drawn out of the node234.

At block 760, the calibration circuit may measure the compensatedcurrent, which results from the addition of the current from the IDAC tothe baseline rectified current. In one embodiment, the calibrationcircuit receives a digital code representing the level of thecompensated current. For example, the compensated current may beconverted by current to code converter 117 to a digital code, which istransmitted to calibration circuit 700.

At decision block 762, the calibration circuit may determine if thecompensated current is minimized using the currently selected IDACvalue. In one embodiment, a calibration circuit, such as calibrationcircuit 700, compares a digitally coded value representing thecompensated current with a threshold value to determine if thecompensated current is sufficiently minimized. In one embodiment, thethreshold value indicates a maximum acceptable current flow in eitherdirection. If the compensated current flow is less than this thresholdamount, the calibration circuit proceeds to block 764. Otherwise, thecalibration circuit proceeds to block 768.

At block 768, the IDAC value may be adjusted. In one embodiment, thisadjustment corresponds to a decrease in the current level that is outputby the IDAC. Alternatively, the adjustment may cause an increase in theIDAC output current. Whether the IDAC current is increased or decreasedat block 768 may depend on whether the current value to which the IDACis set at block 756 or block 764 is higher or lower than the expectedfinal compensation current. In one embodiment, a linear search algorithmis used, where the IDAC is set at a high initial value and the value isdecreased incrementally to the target value. Alternatively, other searchalgorithms, such as successive approximation, may also be used. The IDACvalue is set according to the search algorithm being used and theprocess continues at block 758 with the new IDAC setting.

Thus, blocks 768, 758, 760, and 762 may be repeated until the IDAC valuesufficiently minimizes the compensated current. When the compensatedcurrent is sufficiently minimized by the IDAC value, the processcontinues at block 764, in accord with decision block 762.

At block 764, the IDAC value, which sufficiently minimizes thecompensated current, may be stored in a memory of the calibrationcircuit. For example, the IDAC value may be stored as a digital value inmemory 701 of calibration circuit 700.

At decision block 766, the calibration circuit may determine whether anIDAC value has been determined for all of the transmit and receiveelectrode pairs. If not all pairs have been processed, the processcontinues at block 770.

At block 770, the calibration circuit may connect the next pair oftransmit and receive electrodes to the capacitive sensing circuit. Theprocess then continues at block 756.

Thus, blocks 770, 756, 758, 760, 762, 768, 764, and 766 may be repeateduntil an IDAC value that sufficiently minimizes the compensated currenthas been determined for each transmit and receive electrode pair.

When an IDAC value has been determined for each transmit and receiveelectrode pair, the calibration process 750 continues to block 780 inaccord with decision block 766. At block 780, the process 750 ends.

When the calibration process 750 is completed, a compensation currentvalue has been determined for each transmit and receive electrode pair.In one embodiment, these compensation current values are stored inmemory 701 of calibration circuit 700. During normal operation of thecapacitance sensing circuit, when a particular transmit and receiveelectrode pair are selected, the associated compensation current valuefor that pair can be retrieved from memory 701 and used to set theoutput current of the compensation circuit. Thus, the calibrationcircuit and the compensation current level can compensate fordifferences in mutual and parasitic capacitances between differenttransmit and receive electrode pairs.

The embodiments described herein include a capacitance sensing circuitthat senses a capacitance between a transmit and a receive electrode byapplying a transmit signal to the transmit electrode to induce a currentat the receive electrode. Embodiments of the capacitance sensing circuitalso compensate for a baseline capacitance between the transmit andreceive electrodes to optimize the dynamic range utilization of thecapacitance sensing circuit.

The embodiments described herein may have the advantage of keeping allbenefits of switching capacitor methods (especially in the high immunityfor RF/EMI noise signals), and may be configured for easy implementationin existing devices from hardware and software perspectives, as well asin future devices.

Embodiments of the present invention, described herein, include variousoperations. These operations may be performed by hardware components,software, firmware, or a combination thereof. As used herein, the term“coupled to” may mean coupled directly or indirectly through one or moreintervening components. Any of the signals provided over various busesdescribed herein may be time multiplexed with other signals and providedover one or more common buses. Additionally, the interconnection betweencircuit components or blocks may be shown as buses or as single signallines. Each of the buses may alternatively be one or more single signallines and each of the single signal lines may alternatively be buses.

Certain embodiments may be implemented as a computer program productthat may include instructions stored on a machine-readable medium. Theseinstructions may be used to program a general-purpose or special-purposeprocessor to perform the described operations. A machine-readable mediumincludes any mechanism for storing or transmitting information in a form(e.g., software, processing application) readable by a machine (e.g., acomputer). The machine-readable medium may include, but is not limitedto, magnetic storage medium (e.g., floppy diskette); optical storagemedium (e.g., CD-ROM); magneto-optical storage medium; read-only memory(ROM); random-access memory (RAM); erasable programmable memory (e.g.,EPROM and EEPROM); flash memory; electrical, optical, acoustical, orother form of propagated signal (e.g., carrier waves, infrared signals,digital signals, etc.); or another type of medium suitable for storingelectronic instructions.

Additionally, some embodiments may be practiced in distributed computingenvironments where the machine-readable medium is stored on and/orexecuted by more than one computer system. In addition, the informationtransferred between computer systems may either be pulled or pushedacross the communication medium connecting the computer systems.

Although the operations of the method(s) herein are shown and describedin a particular order, the order of the operations of each method may bealtered so that certain operations may be performed in an inverse orderor so that certain operation may be performed, at least in part,concurrently with other operations. In another embodiment, instructionsor sub-operations of distinct operations may be in an intermittentand/or alternating manner.

In the foregoing specification, the invention has been described withreference to specific exemplary embodiments thereof. It will, however,be evident that various modifications and changes may be made theretowithout departing from the broader spirit and scope of the invention asset forth in the appended claims. The specification and drawings are,accordingly, to be regarded in an illustrative sense rather than arestrictive sense.

What is claimed is:
 1. A device, comprising: a sensor including a firstelectrode and a second electrode coupled capacitively, wherein the firstelectrode is driven by a transmit signal to induce a receive (RX) signalat the second electrode, wherein a baseline capacitance between thedriven first electrode and the second electrode is defined when noexternal input is present; a demodulation circuit that generates amodified signal based on the RX signal, wherein in a first configurationthe demodulation circuit outputs a positive modified signal based on apositive portion of the RX signal, and in a second configuration thedemodulation circuit outputs a negative modified signal based on anegative portion of the RX signal; and a compensation circuit receivingthe modified signal, wherein the compensation circuit is configured togenerate a compensation signal to offset at least a portion of themodified signal to output a compensated RX signal, wherein thecompensation signal is calibrated in accordance with the baselinecapacitance, the compensation circuit further including a first currentsource configured to provide a first compensation signal for combiningwith the positive modified signal in the first configuration, and asecond current source configured to provide a second compensation signalfor combining with the negative modified signal in the secondconfiguration.
 2. The device of claim 1, wherein the modified signal isgenerated by a half wave rectification operation.
 3. The device of claim1, wherein the modified signal is generated by a full wave rectificationoperation and the demodulation circuit comprises: a first half waverectifier receiving the RX signal and configured to output the positivemodified signal based on the positive portion of the RX signal; and asecond half wave rectifier receiving the RX signal and configured tooutput the negative modified signal based on the negative portion of theRX signal.
 4. The device of claim 1 wherein the first electrode includesa transmit (TX) electrode and the second electrode includes a receive(RX) electrode, the sensor further includes a plurality of the TXelectrodes and a plurality of the RX electrodes.
 5. The device of claim4, further comprising a calibration circuit configured to adjust thecompensation signal based on measured capacitance values between theplurality of TX electrodes and the plurality of RX electrodes.
 6. Thedevice of claim 5, further comprising a memory configured to store acompensation signal value which is determined by the measuredcapacitance value between a pair of electrodes including the TXelectrode and the RX electrode.
 7. The device of claim 1, wherein thecompensation signal is approximately equal to the modified signal inmagnitude.
 8. The device of claim 1, wherein the compensation circuitcomprises a programmable current digital to analog converter (IDAC). 9.The device of claim 8, wherein the compensation signal is a currentvalue for the programmable IDAC.
 10. The device of claim 1, furthercomprising a transimpedance amplifier configured to generate an outputvoltage based on the compensated RX signal.
 11. The device of claim 10,further comprising a filter configured to reduce a ripple voltage of theoutput voltage.
 12. A method, comprising: applying a transmit signal toa first electrode capacitively coupled to a second electrode to generatea receive (RX) signal at the second electrode; determining a baselinecapacitance as a measured capacitance value between the first electrodecarrying the transmit signal and the second electrode when no externalinput is present; receiving the RX signal from the second electrode;outputting a modified RX signal based on the RX signal, including:outputting a positive modified signal based on a positive portion of theRX signal in a first configuration and outputting a negative modifiedsignal based on a negative portion of the RX signal in a secondconfiguration; generating a compensation signal corresponding to thebaseline capacitance, wherein the compensation signal is calibrated tooffset at least a portion of the modified RX signal, including providinga first compensation signal for combining with the positive modifiedsignal in the first configuration and providing a second compensationsignal for combining with the negative modified signal in the secondconfiguration; and generating a compensated RX signal, includingcombining the first compensation signal to the positive modified RXsignal in the first configuration, and combining the second compensationsignal to the negative modified RX signal in the second configuration.13. The method of claim 12, further comprising: generating an outputvoltage based on the compensated RX signal; and filtering the outputvoltage to reduce a ripple voltage.
 14. The method of claim 13, furthercomprising: generating a digital code based on the output voltage; anddetermining a presence of the external input based on the digital code.15. The method of claim 13, further comprising reducing a ripple voltageof the output voltage.
 16. The method of claim 12, wherein thecompensation signal is approximately equal to the modified RX signal inmagnitude.
 17. The method of claim 12, wherein the compensation signalis a current value for a programmable IDAC.
 18. The method of claim 12,wherein the outputting the modified RX signal includes rectifying the RXsignal.
 19. An apparatus, comprising: a signal generator to provide atransmit signal; a sensor comprising a plurality of first electrodeswherein each first electrode is driven by the transmit signal configuredto induce a receive (RX) signal at each of a plurality of secondelectrodes, wherein each capacitive coupling of a pair of the firstelectrodes and the second electrodes produces a baseline capacitancevalue when no external input is present; a demodulation circuit, coupledwith the sensor, that generates a modified RX signal based on the RXsignal for each of the pair of the first and second electrodes, whereinin a first configuration the demodulation circuit outputs a positivemodified signal based on a positive portion of the RX signal, and in asecond configuration the demodulation circuit outputs a negativemodified signal based on a negative portion of the RX signal; and acompensation circuit, coupled with the demodulation circuit, to add acompensation signal to the modified RX signal to generate a compensatedRX signal, wherein the compensation signal is calibrated to cancel aportion of the modified RX signal corresponding to the baselinecapacitance value of the pair of the first and second electrodes,wherein the compensation circuit further includes a first current sourceconfigured to provide a first compensation signal for combining with thepositive modified signal in the first configuration, and a secondcurrent source configured to provide a second compensation signal forcombining with the negative modified signal in the second configuration.